RegistryPolicy.WriteListOfValues Method (RegistryHive, String, String[], String[], RegistryValueKind, Boolean)

 

Writes a list of registry-based policy settings that configure String or ExpandString registry values. The registry values are specified by an array of value names and a corresponding array of value data; additive can be optionally specified.

Namespace:   Microsoft.GroupPolicy
Assembly:  Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)

Syntax

public void WriteListOfValues(
    RegistryHive hive,
    string keyPath,
    string[] valueNames,
    string[] values,
    RegistryValueKind type,
    bool additive
)
public:
void WriteListOfValues(
    RegistryHive hive,
    String^ keyPath,
    array<String^>^ valueNames,
    array<String^>^ values,
    RegistryValueKind type,
    bool additive
)
member WriteListOfValues : 
        hive:RegistryHive *
        keyPath:string *
        valueNames:string[] *
        values:string[] *
        type:RegistryValueKind *
        additive:bool -> unit
Public Sub WriteListOfValues (
    hive As RegistryHive,
    keyPath As String,
    valueNames As String(),
    values As String(),
    type As RegistryValueKind,
    additive As Boolean
)

Parameters

  • valueNames
    Type: System.String[]

    An array of strings that contains the names of the registry values. You can specify an empty string (“”) for the default value.

  • values
    Type: System.String[]

    An array of strings that contains the value data.

Exceptions

Exception Condition
ObjectDisposedException

The RegistryPolicy is disposed.

InvalidOperationException

The RegistryPolicy instance is read-only.

ArgumentNullException

keyPath is null or values is null

ArgumentException

keyPath is an empty string (“”)

-or-

values is an empty string (“”)

-or-

hive is not CurrentUser or LocalMachine

-or-

type is not ExpandString or String

-or-

Array lengths of valueNames and values are not equal

See Also

WriteListOfValues Overload
RegistryPolicy Class
Microsoft.GroupPolicy Namespace

Return to top